import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'
import { resolve } from 'path'

const pathResolve = (pathStr: string): string => {
    return resolve(__dirname, '.', pathStr)
}

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [reactRefresh()],
    base: './',
    publicDir: '',
    server: {
        host: '0.0.0.0'
    },
    resolve: {
        alias: {
            '@': pathResolve('./src'),
        }
    },
    css: {
        preprocessorOptions: {
            less: {
                // 支持内联 JavaScript
                javascriptEnabled: true,
            }
        },
    },

})
